package com.zmn.oms.third.jddj.service;

import com.zmn.oms.common.exception.OmsBaseException;
import com.zmn.oms.model.entity.work.OrderWorkLogChange;
import com.zmn.oms.third.jddj.dto.JddjRequestDTO;

/**
 * 京东到家渠道对接接口定义
 *
 * @author xiewenbing
 * @date 2021/01/18
 */
public interface JddjService {

    /**
     * 处理创建订单请求
     *
      * @param requestDTO
     * @throws OmsBaseException
     */
    void handleCreateOrder(JddjRequestDTO requestDTO) throws OmsBaseException;

    /**
     * 处理取消订单请求
     *
     * @param requestDTO
     * @throws OmsBaseException
     */
    void handleCancelOrder(JddjRequestDTO requestDTO) throws OmsBaseException;

    /**
     * 刷新token
     *
     * @param tokenContent
     * @throws OmsBaseException
     */
    void handleRefreshToken(String tokenContent) throws OmsBaseException;

    /**
     * 同步订单确认
     *
     * @param orderWorkLogChange
     * @throws OmsBaseException
     */
    void syncOrderConfirm(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 同步师傅上门
     *
     * @param orderWorkLogChange
     * @throws OmsBaseException
     */
    void syncMasterVisit(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 同步订单完成
     *
     * @param orderWorkLogChange
     * @throws OmsBaseException
     */
    void syncOrderComplete(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 同步订单取消
     *
     * @param orderWorkLogChange
     * @throws OmsBaseException
     */
    void syncOrderCancel(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 创建订单
     *
     * @param outerId
     * @throws OmsBaseException
     */
    void createOrderByChannelOrderId(String outerId) throws OmsBaseException;

    /**
     * 创建订单
     *
     * @param msg
     * @throws OmsBaseException
     */
    Long createOrderByMsgContent(String msg) throws OmsBaseException;

    /**
     * 效验核销码
     *
     * @param orderId
     * @param vCode
     */
    void validateVerificationCode(Long orderId, String vCode) throws OmsBaseException;

    /**
     * 效验核销码,访问cds
     *
     * @param orderId
     * @param vCode
     */
    void validateVerificationCodeV2(Long orderId, String vCode) throws OmsBaseException;

    /**
     * 完成验证
     *
     * @param orderId
     * @param workId
     */
    boolean verifyComplete(Long orderId, Long workId);

    /**
     * 读取已校验的核销码
     * @param orderId
     * @return
     */
    String getVerificationCode(Long orderId) throws OmsBaseException;
}
